<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <script src="老师itcast.core.js"></script>
    <script src=老师itcast.dom.js></script>
    <style>
        .container {
            width: 200px;
            height: 300px;
            border: 1px dashed blue;
        }
        .box {
            width: 100px;
            height: 50px;
            border: 1px solid red;
            margin: 20px auto;
        }
    </style>
</head>
<body>
<div class="container"></div>
</body>
<script>
//    var obj1 = I( 'div' );
//
//    var obj2 = I( '<div style="width: 400px; height: 400px; background: red;">123</div>' );
//
//    document.body.appendChild( obj2[ 0 ] );


    Itcast.fn.appendTo=function(dom){
//    for(var i=0;i<this.length;i++){
//        dom.appendChild(this[i]);
//    }
        return this.each(function(){
            dom.appendChild(this)
        })
    }
    var dom=I('<div  class="box">123</div>'+
            '<div  class="box">123</div>'+
            '<div  class="box">123</div>');
    dom.appendTo(document.getElementsByClassName("container")[0])
</script>
</html>